import java.util.Scanner;

//求 N 的阶乘  。
public class Question2 {

    public static void main(String[] args) {

        int n;
        System.out.println("请输入要求阶乘的数：");
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();

        int ret = ret(n);
        System.out.println(n+"的阶乘为："+ret);

    }

    public static int ret(int n){

        int ret = 1;

        int i = 1;
        while(i <=n ){

            ret *= i;
            i++;

        }
        return ret;

    }

}
